package com.openharmony.filepicker.filetype;


import com.openharmony.filepicker.ResourceTable;

public class WebFileType extends FileType{

    public WebFileType() {
        this.setFileType("Web");
        this.setFileIconResId(ResourceTable.Media_ic_html_file_picker);
    }

    @Override
    public boolean verify(String fileName) {
        boolean isHasSuffix = fileName.contains(".");
        if (!isHasSuffix) {
            return false;
        }
        String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);

        switch (suffix) {
            case "asp":
            case "aspx":
            case "cer":
            case "cfm":
            case "csr":
            case "css":
            case "dcr":
            case "html":
            case "htm":
            case "js":
            case "jsp":
            case "php":
            case "rss":
            case "xhtml":
                return true;
            default:
                return false;
        }
    }
}
